<?php 
	$front = Zend_Controller_Front::getInstance();
	
	//get module name
	$module =  $front->getRequest()->getModuleName();
	
	//get controller name
	$controller = $front->getRequest()->getControllerName();
	
	//get action	
	$action = $front->getRequest()->getActionName(); 
?>
<form id="frmAdminForm" method="get">
	<div class="searchBox">
	
			<!-- title -->
			<div class="searchBoxLeft">
				<label class="title">Tìm kiếm</label>
			</div>
			
			<!-- search field-->
			<div class="searchBoxRight">
				<div class="blockField">
					<label for="keyword">Từ khóa</label>  				
					<input type="text"	name="keyword" value="<?php echo $this->keyword;?>" id="keyword">								 
				</div>	
									
				<!-- 
				<div class="blockField">
					<label for="searchStatus">Trạng thái</label> 
					<select name="searchStatus"	id="searchStatus">
						<option value="">Trạng thái</option>
						<option value="1" <?php //echo ($this->status=="1") ? "selected=selected" : ""; ?> >Kích hoạt</option>
						<option value="0" <?php //echo ($this->status=="0") ? "selected=selected" : ""; ?> >Ẩn</option>
					</select> 
				</div>
				
				<div class="blockField">
					<label for="fromDate">Từ ngày</label> 
					<input type="text"
						name="fromDate" value="<?php //echo $this->fromDate?>"
						class="datepicker" id="fromDate"> 
				</div>

				<div class="blockField">
					<label for="toDate">Đến ngày</label>
					<input type="text" name="toDate" value="<?php //echo $this->toDate?>"
						class="datepicker" id="toDate"> 			
				</div>
			 -->
				<div class="blockField">
					<button name="search" class='button'> Tìm kiếm </button>
					<input type='reset' value="Xóa"
						name="reset" class="reset button" />
				</div>
				<div class="clearb"></div>
			</div>
			
			<!-- filter -->
		
		<div class="clearb"></div>
	</div>

	<!-- list table -->
	<div class="listElement">
		
			<table>
				<thead>
					<tr>
						<th>STT</th>
						<th>
							<input type="checkbox" id="checkall" value='checkall' /><label
								for="checkall"></label>
						</th>
						<th>
							<?php echo $this->partial('partial/sort.phtml','admin',array(
								'columnname'=>'advertisement_category_name',
								'columntitle'=>'Tên phân loại')
							)?>
						</th>
						<th>
							<?php echo $this->partial('partial/sort.phtml','admin',array(
								'columnname'=>'advertisement_category_creation_time',
								'columntitle'=>'Ngày tạo')
							)?>
						</th>
						<th>Thao tác</th>
					</tr>
				</thead>
				<tbody>
					<?php 
						//số thứ tự bằng trang hiện tạ - 1, nhân với số phần tử hiển thị trong trang.
						$stt = ($this->paginator->getCurrentPageNumber()-1)*$this->paginator->getItemCountPerPage();
						$stt+=1;
					?>
					<?php 
						foreach($this->paginator as $item):
							
					?>
					
					<tr>
						<td><?php echo $stt++?></td>
						<td><input type="checkbox" value="<?php echo $item['advertisement_category_id']?>"
							name="id[]" /></td>
						<td>
							<?php echo $item["advertisement_category_name"]?>
							<br />
							<?php echo "alias: ". $item['advertisement_category_alias']?>
						</td>
						
						<td>
							<?php 
								$date = date_create($item['advertisement_category_creation_time']);
								echo date_format($date, 'd/m/Y');
							?>
						</td>
						
						<td>
							<a
								href="<?php echo $this->baseUrl()."/admin/advertisement/index/id/{$item["advertisement_category_id"]}"?>"
								title="xem" class="view option"> 
								xem
								<!-- <span class="small-view-icon">&nbsp;</span>  -->
							</a> 
							<a
								href="<?php echo $this->baseUrl()."/admin/".$controller."/update/id/{$item["advertisement_category_id"]}"?>"
								title="cập nhật" class="edit option"> 
								<span class="small-edit-icon">&nbsp;</span>
							</a> 
							<a
								href="<?php echo $this->baseUrl()."/admin/".$controller."/delete/id/{$item["advertisement_category_id"]}"?>"
								title="xóa" class="delete option"> 
								<span class="small-delete-icon">&nbsp;</span>
							</a>
						</td>
					</tr>
					<?php endforeach;?>
				</tbody>
			</table>
		<input type="hidden" name='order' value="" id="order" />
		<div class="controller">			
							
			<?php echo $this->paginationControl($this->paginator,'Sliding','partial/pagination.phtml'); ?>	
			
		</div>
	</div>
</form>
<div class="clearb">&nbsp;</div>